def filter_users(users, params, g):
    if params.get('username') is not None:
        users = users.filter_by(username=params['username'])
    if params.get('mobile') is not None:
        users = users.filter_by(mobile=params['mobile'])
    if params.get('email') is not None:
        users = users.filter_by(email=params['email'])
    return users
